﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Services.Common
{
    public class ISMServiceStack
    {
        private Dictionary<string, ISMServiceProvider> stacks { get; set; }
        static ISMServiceStack instance;
        public static ISMServiceStack sharedInstance
        {
            get
            {
                if (instance == null)
                    instance = new ISMServiceStack();
                return instance;
            }
        }
        public ISMServiceStack()
        {
            stacks = new Dictionary<string, ISMServiceProvider>();
        }
        public ISMServiceProvider this[string key]
        {
            get
            {
                return stacks[key];
            }
        }

        public void RegisterService(string key,ISMServiceProvider provider)
        {
            stacks.Add(key, provider);
        }
    }
}
